<ui:composition template="/WEB-INF/templates/main-template.xhtml" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" >
	
	<ui:param name="pageName" value="Print Asset Request" />
	
	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml"/>
	</ui:define>
	<ui:define name="content">
		
		
		<h:form id="asset"> 
		 <p:growl/>		  
		 
		 <h:panelGrid>
		 <h:panelGrid id="printPage">
		 <h:outputText value="Asset Request Form" styleClass="outputTextTitle"/>	
		 <p:panel header="Employee Details">		 
		 <h:panelGrid columns="6" cellspacing="8" columnClasses="employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailText, employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailText" >
		          
           <h:outputLabel value="Asset Code" />
           <h:outputLabel value=":" />
           <h:outputText value="#{printAssetRequestBean.viewAssetRequest.assetReferenceCode}" />
           
           <h:outputLabel value="Request Date" />
           <h:outputLabel value=":" />
           <h:outputText value="#{printAssetRequestBean.viewAssetRequest.requestDate}" >
           		<f:convertDateTime pattern="dd-MMM-yyyy HH:mm a" timeZone="#{printAssetRequestBean.timeZone}"/> 
           </h:outputText>

           <h:outputLabel value="Employee Name " />
           <h:outputLabel value=":" />
           <h:outputText value="#{printAssetRequestBean.viewAssetRequest.employee.firstName} #{printAssetRequestBean.viewAssetRequest.employee.lastName}" />
           
           <h:outputLabel value="Module Name " />
           <h:outputLabel value=":" />
           <h:outputText value="#{printAssetRequestBean.viewAssetRequest.employee.moduleName}" />
		              
           <h:outputLabel value="Recommended By" />
           <h:outputLabel value=":" />
           <h:outputText value="#{printAssetRequestBean.viewAssetRequest.recommendedBy.firstName} #{printAssetRequestBean.viewAssetRequest.recommendedBy.lastName}" />

           <h:outputLabel value="Approved By " />
           <h:outputLabel value=":" />
           <h:outputText value="#{printAssetRequestBean.viewAssetRequest.approvedBy.firstName} #{printAssetRequestBean.viewAssetRequest.approvedBy.lastName}"  />
           
           <h:outputLabel value="System Administrator " />
           <h:outputLabel value=":" />
           <h:outputText value="#{printAssetRequestBean.viewAssetRequest.assigedByEmployee.firstName} #{printAssetRequestBean.viewAssetRequest.assigedByEmployee.lastName}" />
           
          </h:panelGrid> 
           
          <h:outputLabel value="Asset Details" style="font-weight:bold;color: #00A2DE;"/>
          <p:dataTable  value="#{printAssetRequestBean.viewAssetDetailsList}" var="viewAssetDetails" >
		            
		            <p:column headerText="Asset Type"> 
		              	<h:outputText value="#{viewAssetDetails.assetType}" />                 
		            </p:column>  
		  
		            <p:column headerText="Required On"> 
		              	<h:outputText value="#{viewAssetDetails.requiredDate}" > 
		              		<f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{printAssetRequestBean.timeZone}"/>
		              	</h:outputText> 	               
		            </p:column>  
		            
		            <p:column headerText="Return Date"> 
		              	<h:outputText value="#{viewAssetDetails.expectedReturnDate}" >
		              		<f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{printAssetRequestBean.timeZone}"/>
		              	</h:outputText>                  
		            </p:column>  
		            
		            <p:column headerText="Purpose"> 
		              	<h:outputText value="#{viewAssetDetails.purpose}" />  	               
		            </p:column>  
		            
		            <p:column headerText="Remarks"> 
		              	<h:outputText value="#{viewAssetDetails.remarks}" />                 
		            </p:column>  
		            
		            <p:column headerText="Status"> 
		            	<h:outputText value="#{viewAssetDetails.assetStatus}" />
		            </p:column>
		            
		           <p:column headerText="Asset Code"> 
		            	<h:outputText value="#{viewAssetDetails.assetMaster.assetCode}" />
		            </p:column>	
		            
		            <p:column headerText="Assigned Date"> 
		            	<h:outputText value="#{viewAssetDetails.assetMaster.assignedDate}">
		            		<f:convertDateTime pattern="dd-MMM-yyyy" timeZone="#{printAssetRequestBean.timeZone}"/>
		            	</h:outputText>
		            </p:column>	
		            
		             <p:column headerText="Details" > 
		             	<p:commandButton icon="ui-icon-search" oncomplete="assetVeiwDialog.show()" update=":asset:assetVeiwDialog">
							<f:setPropertyActionListener target="#{printAssetRequestBean.viewAssetMaster}" value="#{viewAssetDetails}"></f:setPropertyActionListener>
						</p:commandButton>
		            </p:column>   	
		           		            
			       
          </p:dataTable><br/>
          
                  <h:panelGrid columns="3">
             	    <h:outputLabel value="Approval Level-1" style="font-weight:bold;color: #00A2DE;"/>
             	    <h:inputHidden /><h:inputHidden />
             	    <h:outputText value="Recommender Status " style="font-weight:bold;" />
             	    <h:outputText value=" : " style="font-weight:bold;" />
		            <h:outputText value="#{printAssetRequestBean.viewAssetRequest.recommenderStatus}" />
		            
		            <h:outputText value="Recommender Comments " style="font-weight:bold;" />
		            <h:outputText value=" : " style="font-weight:bold;" />
		            <font face="comic sans MS, new york, times" size="2"><b>
									#{printAssetRequestBean.viewAssetRequest.recommenderComments}</b></font>
		            
		           
		           <h:inputHidden /><h:inputHidden /><br/>
		            <h:outputLabel value="Approval Level-2" style="font-weight:bold;color: #00A2DE;"/>
             	    <h:inputHidden /><h:inputHidden />
             	    
		            <h:outputText value="Approver Status " style="font-weight:bold;" />
		            <h:outputText value=" : " style="font-weight:bold;" />
		            <h:outputText value="#{printAssetRequestBean.viewAssetRequest.approverStatus}" />
		            
		            <h:outputText value="Approver Comments " style="font-weight:bold;vertical-align:top;" />
		            <h:outputText value=" : " style="font-weight:bold;" />		          
		            <font face="comic sans MS, new york, times" size="2"><b>
									#{printAssetRequestBean.viewAssetRequest.approverComments}</b></font>
		       
		            	            
             	</h:panelGrid>
             	</p:panel>	
             	</h:panelGrid>
             		<h:panelGrid style="float:right;">
	             		<h:panelGroup >		
							<p:commandButton value="Print" type="button" icon="ui-icon-print">
								<p:printer target="printPage" />
						    </p:commandButton>	 					    
							<p:commandButton value="Back" action="raiseassetrequest" />	
					    </h:panelGroup>		
             	    </h:panelGrid>
             	</h:panelGrid>
            
				<p:dialog hideEffect="fade" showEffect="fade"
				header="View Asset Details "
				id="assetVeiwDialog" widgetVar="assetVeiwDialog" resizable="false"
				modal="true" >
				
				<h:panelGrid columns="6" cellspacing="8" columnClasses="employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailText, employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailText" >
                			          
			           <h:outputLabel value="Asset Type" />
			           <h:outputLabel value=":" />
			           <h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.assetType}" />
			         
			           <h:outputLabel value="Asset Code" />
			           <h:outputLabel value=":" />
			           <h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.assetCode}" />
			           
			           <h:outputLabel value="Asset Name" />
			           <h:outputLabel value=":" />
			           <h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.assetName}" />
			       
			           <h:outputLabel value="Manufacturer" />
			           <h:outputLabel value=":" />
			           <h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.manufacturer}" />
			        
			           <h:outputLabel value="Model" />
			           <h:outputLabel value=":" />
			           <h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.model}" />   
			    
			           <h:outputLabel value="Processor" />
			           <h:outputLabel value=":" />
			           <h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.processor}" />			       
			       
			           <h:outputLabel value="Hard Disk" />
			           <h:outputLabel value=":" />
			           <h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.hardDisk}" />
			         
			           <h:outputLabel value="Serial Number" />
			           <h:outputLabel value=":" />
			           <h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.serialNumber}" />
			      
			           <h:outputLabel value="Memory (GB)" />
			           <h:outputLabel value=":" />
			           <h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.memory}" />
			    
			           <h:outputLabel value="OS" />
			           <h:outputLabel value=":" />
			           <h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.os}" />	
	          </h:panelGrid>	
	          <h:panelGrid >
	                    <h:outputLabel value="Asset Description : " style="font-weight:bold;"/>
			          	<h:outputLabel value="#{printAssetRequestBean.viewAssetMaster.assetMaster.assetDescription}" />		              
		      </h:panelGrid>			
						
				<h:panelGroup style="float:right;">								
					<p:commandButton id="closeButton" process="@this" value="Close" oncomplete="assetVeiwDialog.hide()" />
						
				</h:panelGroup>	
			</p:dialog> 
			
         
     </h:form>
	</ui:define>
	
</ui:composition>
